/**
 * Created by Mark_ren on 2016/11/7.
 * 苟富贵,無相忘
 */

var express = require('express');
var router = express.Router();
var co = require('co');
var seqModule = require('./createModules');
var seq = new seqModule();

/**
 * 查询方法
 */
router.get('/getDicBytypes', function (req, res, next) {
    co(function() {
        var params = {};
        var paramT = {};

        params["types"] = req.query.types;
        paramT["where"] = params;
        paramT["order"]=[["codeId",'asc']];
        seq.dictionaryModule.findAll(paramT).then(function (result) {
            res.json({"success": true, "result": result});
        });

    }).catch(function (e) {
        res.json({'success': false, 'msg': '查询失败'});
        console.log(e);
    })
});

module.exports = router;